package com.fc.app.fcapp.pages.recycler

import android.app.Activity
import android.os.Bundle
import android.support.v7.widget.RecyclerView
import com.fc.app.fcapp.R
import android.support.v7.widget.LinearLayoutManager



/**
 * Created by fc on 2017/10/30.
 */
class RecycleActivity : Activity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.recycle_list_view)


        val mainView: RecyclerView = findViewById<RecyclerView>(R.id.recycle_main) as RecyclerView
      //设置RecyclerView管理器
        mainView.layoutManager = LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false)
        val datas  = mutableListOf<Int>()
        for (i in 0..9) {
            datas.add(i)
        }
        datas.add(R.mipmap.net_speed_check_write_ball)

        val adapter = MyRecyclerViewAdapter(datas)
        mainView.adapter = adapter
    }
}